package com.bullsora.kindlerss.model.constraint;

import org.hibernate.validator.constraints.impl.EmailValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * The string has to be a well formed cron expression.
 * 
 * @author Sorin Buliarca
 */
@Documented
@Constraint(validatedBy = CronValidator.class)
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
public @interface Cron {
  String message() default "{com.bullsora.constraint.Cron.message}";

	Class<?>[] groups() default { };

	Class<? extends Payload>[] payload() default { }; 
}
